package com.test.tinyurl.util;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import javax.servlet.http.HttpServletRequest;

/**
 * 分页信息
 */
public final class PageLimitUtil {

    public static final String PAGE = "page";
    public static final String LIMIT = "limit";

    public static Page page(HttpServletRequest request) {
        int current = Integer.valueOf(request.getParameter(PAGE));
        int size = Integer.valueOf(request.getParameter(LIMIT));
        return new Page<>(current, size);
    }
}
